<!DOCTYPE html>
<html lang="en">
<head>
    {include file='public/header' /}
    <!-- Bootstrap Dropify CSS -->
    <link href="__PUBLIC__/admin/vendors/bower_components/dropify/dist/css/dropify.min.css" rel="stylesheet" type="text/css"/>

    <!-- Data table CSS -->
    <link href="__PUBLIC__/admin/vendors/bower_components/datatables/media/css/jquery.dataTables.min.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" href="__PUBLIC__/index/css/weui.min.css">
    <link rel="stylesheet" href="__PUBLIC__/index/css/jquery-weui.css">
    <!-- Custom CSS -->
    {include file='public/comn_css' /}

</head>
<body>
<!--Preloader-->
<div class="preloader-it">
    <div class="la-anim-1"></div>
</div>
<!--/Preloader-->
<div class="wrapper  theme-5-active pimary-color-blue">

    <!-- Top Menu Items -->
    {include file='public/top_menu' /}
    <!-- /Top Menu Items -->

    <!-- Left Sidebar Menu -->
    {include file='public/sidebar' /}
    <!-- /Left Sidebar Menu -->

    <!-- Main Content -->
    <div class="page-wrapper">
        <div class="container-fluid">
            <!-- Title -->
            <div class="row heading-bg">
                <div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
                    <h5 class="txt-dark">管理员管理</h5>
                </div>
                <!-- Breadcrumb -->
                <div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
                    <ol class="breadcrumb">
                        <li><a href="{:url('admin/index/index')}">系统首页</a></li>
                        <li><a href="{:url('admin/admin/index')}">管理员管理</a></li>
                        <li class="active"><span>编辑管理员</span></li>
                    </ol>
                </div>
                <!-- /Breadcrumb -->
            </div>
            <!-- /Title -->

            <!-- Row -->
            <div class="row">
                <div class="col-lg-12 col-sm-12">
                    <div class="panel panel-default card-view">
                        <div class="panel-wrapper collapse in">
                            <div class="panel-body">
                                <div  class="pills-struct">
                                        <div  id="home_6" class="tab-pane fade active in" role="tabpanel">
                                            <form class="form-horizontal" id="system_form" method="post" action="{:url('doEdit')}" data-toggle="validator" role="form">
                                                <input type="hidden" name="id" value="{$info.id}">
                                                <div class="form-group">
                                                    <label class="control-label mb-10 col-sm-2" for="username">用户名:</label>
                                                    <div class="col-sm-8">
                                                        <input type="text" class="form-control" id="username" name="username" placeholder="请输入 用户名" value="{$info.username}" disabled>
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label mb-10 col-sm-2" for="password">密码:</label>
                                                    <div class="col-sm-8">
                                                        <input type="tel" class="form-control" id="password" name="password" placeholder="******" value="" data-minlength="6">
                                                        <div class="help-block">如不修改请不要输入！！！</div>
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label mb-10 col-sm-2" for="confirm_pass">确认密码:</label>
                                                    <div class="col-sm-8">
                                                        <input type="tel" class="form-control" id="confirm_pass" name="confirm_pass" placeholder="******" value="" data-match="#password" data-match-error="两次输入的密码不一致">
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label mb-10 col-sm-2" for="level">权限分组:</label>
                                                    <div class="col-sm-8">
                                                        <select name="level" id="level" class="form-control">
                                                            {notempty name='juriList'}
                                                            {foreach name='juriList' item='value'}
                                                            <option value="{$value.id}" {eq name="info.level" value="$value['id']"}selected=""{/eq} >{$value.title}</option>
                                                            {/foreach}
                                                            {/notempty}
                                                        </select>
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label mb-10 col-sm-2">状态</label>
                                                    <div class="col-sm-8">
                                                        <div class="radio radio-info">
                                                            <input type="radio" name="status" id="radio3" value="1" {eq name='info.status' value='1'}checked=""{/eq} >
                                                            <label for="radio3">
                                                                启用
                                                            </label>
                                                        </div>
                                                        <div class="radio radio-info">
                                                            <input type="radio" name="status" id="radio4" value="0" {eq name='info.status' value='0'}checked=""{/eq}>
                                                            <label for="radio4">
                                                                禁用
                                                            </label>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="form-group mb-0">
                                                    <div class="col-sm-offset-2 col-sm-10">
                                                        <button type="submit" id="form-btn" class="btn btn-success" form="system_form"><span class="btn-text">保存</span></button>
                                                    </div>
                                                </div>
                                            </form>
                                        </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- /Row -->

        </div>
        <!-- Footer -->
        {include file='public/footer' /}
        <!-- /Footer -->

    </div>
    <!-- /Main Content -->

</div>
<!-- /#wrapper -->

<!-- JavaScript -->
<!-- jQuery -->
<script src="__PUBLIC__/admin/vendors/bower_components/jquery/dist/jquery.min.js"></script>

<!-- Bootstrap Core JavaScript -->
<script src="__PUBLIC__/admin/vendors/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/admin/vendors/bower_components/bootstrap-validator/dist/validator.min.js"></script>
<!-- Bootstrap Daterangepicker JavaScript -->
<!-- Slimscroll JavaScript -->

<!-- Fancy Dropdown JS -->
<script src="__PUBLIC__/admin/dist/js/dropdown-bootstrap-extended.js"></script>

<!-- Owl JavaScript -->
<script src="__PUBLIC__/admin/vendors/bower_components/owl.carousel/dist/owl.carousel.min.js"></script>

<!-- Switchery JavaScript -->
<script src="__PUBLIC__/admin/vendors/bower_components/switchery/dist/switchery.min.js"></script>

<!-- Init JavaScript -->
{include file='public/comn_js' /}

<script src="__PUBLIC__/admin/dist/js/jquery.form.js"></script>
<script src="__PUBLIC__/admin/vendors/layer/layer.js"></script>
<script>
    $('#system_form').submit(function() {
        var index;
        var obj = $('#form-btn');
        // submit the form
        $(this).ajaxSubmit({
            beforeSubmit: function () {
                if (obj.hasClass('disabled'))
                {
                    return false;
                } else {
                    index = layer.load(1, {shade:[0.6, '#000']});
                }
            },
            success: function (responseText, statusText) {
                if (responseText.status)
                {
                    layer.msg('编辑成功！', {shade: [0.6, '#000'], time:3000}, function () {
                        window.location.href = responseText.msg;
                    });
                } else {
                    layer.msg('编辑失败！', {shade: [0.6, '#000'], time:3000}, function () {
                        $('#system_form').reset();
                    });
                }
            }
        });
        // return false to prevent normal browser submit and page navigation
        return false;
    });
</script>
</body>
</html>